load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
    name = "spdlog",
    hdrs = glob([
        "include/**/*.h",
    ]),
    defines = ["SPDLOG_FMT_EXTERNAL"],
    includes = ["include"],
    visibility = ["//visibility:public"],
    deps = ["@fmt"],
)

cc_test(
    name = "spdlog_test",
    srcs = [
        "tests/includes.h",
        "tests/main.cpp",
        "tests/test_async.cpp",
        "tests/test_backtrace.cpp",
        "tests/test_cfg.cpp",
        "tests/test_circular_q.cpp",
        "tests/test_create_dir.cpp",
        "tests/test_custom_callbacks.cpp",
        "tests/test_daily_logger.cpp",
        "tests/test_dup_filter.cpp",
        "tests/test_eventlog.cpp",
        "tests/test_file_helper.cpp",
        "tests/test_file_logging.cpp",
        "tests/test_fmt_helper.cpp",
        "tests/test_macros.cpp",
        "tests/test_misc.cpp",
        "tests/test_mpmc_q.cpp",
        "tests/test_pattern_formatter.cpp",
        "tests/test_registry.cpp",
        "tests/test_sink.h",
        "tests/test_stdout_api.cpp",
        "tests/test_stopwatch.cpp",
        "tests/test_time_point.cpp",
        "tests/utils.cpp",
        "tests/utils.h",
    ],
    deps = [
        ":spdlog",
        "@catch2//:catch2_main",
    ],
)
